From 67eb91ad6dccf2a14e3f8d3b285c75d251322973 Mon Sep 17 00:00:00 2001
From: mihna123 <mihailonvojinovic@gmail.com>
Date: Mon, 8 Jun 2026 14:19:32 +0200
Subject: feat(blogs): implement blogging functionality

- Implement static blog generation from markdown files
---
 src/app/blogs/[slug]/page.tsx | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 src/app/blogs/[slug]/page.tsx

(limited to 'src/app/blogs/[slug]/page.tsx')

diff --git a/src/app/blogs/[slug]/page.tsx b/src/app/blogs/[slug]/page.tsx
new file mode 100644
index 0000000..3372bea
--- /dev/null
+++ b/src/app/blogs/[slug]/page.tsx
@@ -0,0 +1,36 @@
+import { getBlogFromSlug, markdownToHtml } from '@/lib/blogs/api';
+
+type Params = {
+  params: Promise<{ slug: string }>;
+};
+
+export default async function Blog(props: Params) {
+  const params = await props.params;
+  const blog = getBlogFromSlug(params.slug);
+  const htmlContent = await markdownToHtml(blog.content);
+
+  return (
+    <section className="mt-10 flex justify-center">
+      <div className="w-5xl space-y-4">
+        <h1 className="m-0 mb-2 text-4xl font-bold">{blog.title}</h1>
+        <p>
+          by{' '}
+          <a
+            href={blog.author.social}
+            target="_blank"
+            rel="noopener noreferrerer"
+            className="link"
+          >
+            {blog.author.name}
+          </a>{' '}
+          ~ {blog.date.toLocaleDateString()}
+        </p>
+        <p className="mb-10 text-lg">{blog.excerpt}</p>
+        <article
+          className="markdown"
+          dangerouslySetInnerHTML={{ __html: htmlContent }}
+        />
+      </div>
+    </section>
+  );
+}
-- 
cgit v1.3.1

